﻿using UnityEngine;
using System.Collections;

public class PlatformManager : MonoBehaviour {

	public GameObject pfb;
	public float maxPos, minPos, posOutUp, intervalOfCreate;

	private float timeIntervalOfCreate;

	void Start () {
		timeIntervalOfCreate = intervalOfCreate;
	}
	
	// Update is called once per frame
	void Update () {
		timeIntervalOfCreate -= Time.deltaTime;

		if(timeIntervalOfCreate <= 0)
		{
			GameObject go = Instantiate(pfb, new Vector3(Random.Range(minPos, maxPos), posOutUp, 0), Quaternion.identity) as GameObject;
			timeIntervalOfCreate = intervalOfCreate;
		}
	}
}
